{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/gao/opt/anaconda3/lib/python3.7/site-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.\n",
      "  import pandas.util.testing as tm\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>12669</td>\n",
       "      <td>9656</td>\n",
       "      <td>7561</td>\n",
       "      <td>214</td>\n",
       "      <td>2674</td>\n",
       "      <td>1338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>7057</td>\n",
       "      <td>9810</td>\n",
       "      <td>9568</td>\n",
       "      <td>1762</td>\n",
       "      <td>3293</td>\n",
       "      <td>1776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>6353</td>\n",
       "      <td>8808</td>\n",
       "      <td>7684</td>\n",
       "      <td>2405</td>\n",
       "      <td>3516</td>\n",
       "      <td>7844</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>13265</td>\n",
       "      <td>1196</td>\n",
       "      <td>4221</td>\n",
       "      <td>6404</td>\n",
       "      <td>507</td>\n",
       "      <td>1788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>22615</td>\n",
       "      <td>5410</td>\n",
       "      <td>7198</td>\n",
       "      <td>3915</td>\n",
       "      <td>1777</td>\n",
       "      <td>5185</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Channel  Region  Fresh  Milk  Grocery  Frozen  Detergents_Paper  Delicassen\n",
       "0        2       3  12669  9656     7561     214              2674        1338\n",
       "1        2       3   7057  9810     9568    1762              3293        1776\n",
       "2        2       3   6353  8808     7684    2405              3516        7844\n",
       "3        1       3  13265  1196     4221    6404               507        1788\n",
       "4        2       3  22615  5410     7198    3915              1777        5185"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "cm = pd.read_csv('Wholesale customers data.csv')\n",
    "cm.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 440 entries, 0 to 439\n",
      "Data columns (total 8 columns):\n",
      " #   Column            Non-Null Count  Dtype\n",
      "---  ------            --------------  -----\n",
      " 0   Channel           440 non-null    int64\n",
      " 1   Region            440 non-null    int64\n",
      " 2   Fresh             440 non-null    int64\n",
      " 3   Milk              440 non-null    int64\n",
      " 4   Grocery           440 non-null    int64\n",
      " 5   Frozen            440 non-null    int64\n",
      " 6   Detergents_Paper  440 non-null    int64\n",
      " 7   Delicassen        440 non-null    int64\n",
      "dtypes: int64(8)\n",
      "memory usage: 27.6 KB\n"
     ]
    }
   ],
   "source": [
    "#查看数据缺失值---数据并没有缺失值，数据完整性比较好\n",
    "cm.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.322727</td>\n",
       "      <td>2.543182</td>\n",
       "      <td>12000.297727</td>\n",
       "      <td>5796.265909</td>\n",
       "      <td>7951.277273</td>\n",
       "      <td>3071.931818</td>\n",
       "      <td>2881.493182</td>\n",
       "      <td>1524.870455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.468052</td>\n",
       "      <td>0.774272</td>\n",
       "      <td>12647.328865</td>\n",
       "      <td>7380.377175</td>\n",
       "      <td>9503.162829</td>\n",
       "      <td>4854.673333</td>\n",
       "      <td>4767.854448</td>\n",
       "      <td>2820.105937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>55.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>25.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3127.750000</td>\n",
       "      <td>1533.000000</td>\n",
       "      <td>2153.000000</td>\n",
       "      <td>742.250000</td>\n",
       "      <td>256.750000</td>\n",
       "      <td>408.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>8504.000000</td>\n",
       "      <td>3627.000000</td>\n",
       "      <td>4755.500000</td>\n",
       "      <td>1526.000000</td>\n",
       "      <td>816.500000</td>\n",
       "      <td>965.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>16933.750000</td>\n",
       "      <td>7190.250000</td>\n",
       "      <td>10655.750000</td>\n",
       "      <td>3554.250000</td>\n",
       "      <td>3922.000000</td>\n",
       "      <td>1820.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>112151.000000</td>\n",
       "      <td>73498.000000</td>\n",
       "      <td>92780.000000</td>\n",
       "      <td>60869.000000</td>\n",
       "      <td>40827.000000</td>\n",
       "      <td>47943.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Channel      Region          Fresh          Milk       Grocery  \\\n",
       "count  440.000000  440.000000     440.000000    440.000000    440.000000   \n",
       "mean     1.322727    2.543182   12000.297727   5796.265909   7951.277273   \n",
       "std      0.468052    0.774272   12647.328865   7380.377175   9503.162829   \n",
       "min      1.000000    1.000000       3.000000     55.000000      3.000000   \n",
       "25%      1.000000    2.000000    3127.750000   1533.000000   2153.000000   \n",
       "50%      1.000000    3.000000    8504.000000   3627.000000   4755.500000   \n",
       "75%      2.000000    3.000000   16933.750000   7190.250000  10655.750000   \n",
       "max      2.000000    3.000000  112151.000000  73498.000000  92780.000000   \n",
       "\n",
       "             Frozen  Detergents_Paper    Delicassen  \n",
       "count    440.000000        440.000000    440.000000  \n",
       "mean    3071.931818       2881.493182   1524.870455  \n",
       "std     4854.673333       4767.854448   2820.105937  \n",
       "min       25.000000          3.000000      3.000000  \n",
       "25%      742.250000        256.750000    408.250000  \n",
       "50%     1526.000000        816.500000    965.500000  \n",
       "75%     3554.250000       3922.000000   1820.250000  \n",
       "max    60869.000000      40827.000000  47943.000000  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cm.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Fresh列到Delicassen列的数据数量级大小差别很大，在聚类前需要进行标准化"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 关于标准化、归一化、Normalizer的总结"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "一、数据标准化\n",
    "StandardScaler (基于特征矩阵的列，将属性值转换至服从正态分布)\n",
    "标准化是依照特征矩阵的列处理数据，其通过求z-score的方法，将样本的特征值转换到同一量纲下\n",
    "常用与基于正态分布的算法，比如回归\n",
    "\n",
    "二、数据归一化\n",
    "MinMaxScaler （区间缩放，基于最大最小值，将数据转换到0,1区间上的）\n",
    "提升模型收敛速度，提升模型精度\n",
    "常见用于神经网络\n",
    "\n",
    "三、Normalizer （基于矩阵的行，将样本向量转换为单位向量）\n",
    "其目的在于样本向量在点乘运算或其他核函数计算相似性时，拥有统一的标准\n",
    "常见用于文本分类和聚类、logistic回归中也会使用，有效防止过拟合"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.70833271, 0.53987376, 0.42274083, 0.01196489, 0.14950522,\n",
       "        0.07480852],\n",
       "       [0.44219826, 0.61470384, 0.59953989, 0.11040858, 0.20634248,\n",
       "        0.11128583],\n",
       "       [0.39655169, 0.5497918 , 0.47963217, 0.15011913, 0.2194673 ,\n",
       "        0.48961931],\n",
       "       ...,\n",
       "       [0.36446153, 0.38846468, 0.7585445 , 0.01096068, 0.37223685,\n",
       "        0.04682745],\n",
       "       [0.93773743, 0.1805304 , 0.20340427, 0.09459392, 0.01531   ,\n",
       "        0.19365326],\n",
       "       [0.67229603, 0.40960124, 0.60547651, 0.01567967, 0.11506466,\n",
       "        0.01254374]])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#在此适用Normalizer---使用方法同MinMaxScaler、StandardScaler\n",
    "from sklearn.preprocessing import Normalizer \n",
    "train_data = cm.iloc[:,2:]\n",
    "norm_train_data = Normalizer().fit_transform(train_data)\n",
    "norm_train_data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 适用轮廓系数找到最优K"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'score')"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAApFklEQVR4nO3deXhU5dnH8e+dnSzsIQkQFmUTCbKMiNrWHRFbqLihdWvdl2rtarfXVltb37ZaW3FBq8UqLq9ii4Ja22q1RZQAyioQEGVP2BOQ/X7/mEkMcYQgOTmTzO9zXXMxZ8u5c3Tml3POc57H3B0REZG6UsIuQEREEpMCQkRE4lJAiIhIXAoIERGJSwEhIiJxpYVdQENp3769d+vWLewyRESalBkzZqxz9/x4y5pNQHTr1o3S0tKwyxARaVLM7MPPWqZLTCIiEpcCQkRE4lJAiIhIXAoIERGJSwEhIiJxBRoQZjbczBaaWZmZ3RJn+WVmVmFm78ZeV9RadqmZLY69Lg2yThER+bTAmrmaWSowFjgNWAFMN7NJ7j6/zqpPu/sNdbZtC9wKRAAHZsS23RhUvSIisq8gzyCGAGXuvtTddwJPAaPque3pwKvuviEWCq8Cw4MosmrHbn42aR6bP94VxI8XEWmyggyITsDyWtMrYvPqOtvMZpvZs2ZWfJDbHrKFayp5fNqHfPPJWezeszeIXYiINElh36R+Aejm7v2JniWMP5iNzewqMys1s9KKiorPVcDgrm345Vn9eGNRBb+YvOBz/QwRkeYoyIBYCRTXmu4cm1fD3de7+47Y5MPA4PpuG9t+nLtH3D2Snx+3K5F6Of/oLlzxhe78eeoynnj7M586FxFJKkEGxHSgp5l1N7MMYAwwqfYKZlZUa3IkUP0n/CvAMDNrY2ZtgGGxeYH54YgjOKl3Prf+bR5Tl6wLclciIk1CYAHh7ruBG4h+sS8AnnH3eWZ2m5mNjK12o5nNM7P3gBuBy2LbbgBuJxoy04HbYvMCk5pi/OGCgXRvn8O1j8/kg3Vbg9ydiEjCM3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JnAW8YmZV7j4h7IJE6kMBIdII3H1rbPCeV2MhMSnsmkQORL25iohIXLoHISIicSkgREQkLgWEiIjEpYAQEZG4FBAiIhKXAkJEROJSQIiISFz/DxaBfAdGdm7UAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.cluster import KMeans \n",
    "from sklearn.metrics import silhouette_score #轮廓系数\n",
    "clusters = [2,3,4,5,6]\n",
    "score=[]\n",
    "modle =[]\n",
    "\n",
    "for k in clusters:\n",
    "    kmeans_  = KMeans(n_clusters=k)\n",
    "    kmeans_.fit(norm_train_data)\n",
    "    score.append(silhouette_score(norm_train_data,kmeans_.labels_))\n",
    "    modle.append(kmeans_)\n",
    "    \n",
    "sns.lineplot(clusters,score)\n",
    "plt.xlabel('k')\n",
    "plt.ylabel('score')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 建模及可视化分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.869573</td>\n",
       "      <td>0.174954</td>\n",
       "      <td>0.226061</td>\n",
       "      <td>0.224904</td>\n",
       "      <td>0.050075</td>\n",
       "      <td>0.074002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.264083</td>\n",
       "      <td>0.479221</td>\n",
       "      <td>0.661907</td>\n",
       "      <td>0.134295</td>\n",
       "      <td>0.251450</td>\n",
       "      <td>0.105409</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Fresh      Milk   Grocery    Frozen  Detergents_Paper  Delicassen\n",
       "0  0.869573  0.174954  0.226061  0.224904          0.050075    0.074002\n",
       "1  0.264083  0.479221  0.661907  0.134295          0.251450    0.105409"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#建模\n",
    "kmeans_ = modle[0]\n",
    "center = pd.DataFrame(kmeans_.cluster_centers_,columns=['Fresh','Milk','Grocery','Frozen','Detergents_Paper','Delicassen'])\n",
    "center"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x1a25a3c110>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAWlUlEQVR4nO3deZgU1b3G8W/1AgMIzSKLAlIaY0RRRBZ3MYkbjmg0Imi8MbhdTa5BEhLLXL0plYutEWPidQ1RY9wFImqhJq64AhLAEGRRaVkUAYGCYZi1+/5RDQKyzNLdv1Pdv8/z9OMM0H3eceadU9VVdcrKZDIopcwTkQ6glNo5L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kHwqjXICuIkRwMNA0V1BXGK+As7C9d+VDpJvpVNOADdxIsEtxTsIJ1FNswQYgusvlA5SCMW7z7kzrj8NOJZgCX4VLjOBY0qlmFBq5QRw/QVAf2CKdBTVYHcCx+P6X0oHKaTS2qzdkZv4OcEZRbofaqa1BAtyPScdREJplxPATfQDngK+LR1Fbecd4ILsDa1KUult1u7I9WcDR6InLJgiQ3DY66RSLibozLm94HDLnUBX4SSlaj5wJa7/lnQQE+jMua3gdnDfAe4mOANFFcZm4DfAEVrMr+nMuStuYgDBqX8DpKMUuanAf4Vxdbx803LujpuIEJxAPw5ICKcpNisIzo2dJB3EVFrOhnATXQg2u65ED7s012qCw1f34PqV0mFMpuVsDDfRk+BO2z8B4rJhQucr4HbgLlx/k3SYMNByNoWb6EWwHuol6Ey6J+uA8cAfcf2N0mHCRMvZHG5iH2AUwXWjXYTTmGYxcD/wJ1x/g3SYMNJy5oKbiAM/AK4Avk/pXjdaS3DVz33A69kVKVQTaTlzzU0cAFxGMJt2E05TKEsI1mx6sNROTs8nLWe+uIkYcCpwFjAU2Fc2UM4tJJglpwDv6yyZe1rOQnATFsH5u1uK2k82UJOkgfcJyjillK6rlKLllBAckjkVOAoYBPQBoqKZvikNfEhwdcg7wGu6yVpYWk4TuInWBBeAbylrf2A/CneLxiqC1SHmEtyx7QNglh76kKXlNFWwz9oDsHd49ALaA22A1tv8t8UOr1ADVACbtnn4wGcEt8dbss1jpe4zmkfLWSyCMrcmOIyzCdfXWyKGnJZTKUPp9ZxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGUrLqZShtJxKGer/AXteaH5NkxKFAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "km_labels = pd.Series(kmeans_.labels_)\n",
    "sizes = km_labels.value_counts(1).values\n",
    "labels = km_labels.value_counts(1).index\n",
    "plt.pie(sizes,autopct='%.f%%')\n",
    "plt.legend(labels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([0, 1]), [Text(0, 0, '0'), Text(1, 0, '1')])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAbvklEQVR4nO3de1RVdf7/8ecb1DBtWF5oKjGx+ZqGXI6IaDGW6ddL5mDa1Uylu6U2k+VkK0cNbU0Xq+8qWTW2Ku1bozRW5JRNRmYXl6VoaOINNOYrTivJTMOkFD+/P0B+SFxOdODA5vVYq7XO3vuz93lv0Vebz9n7fcw5h4iINH8hwS5AREQCQ4EuIuIRCnQREY9QoIuIeIQCXUTEI1oF6407d+7soqKigvX2IiLN0saNG79xzkVUty1ogR4VFUV2dnaw3l5EpFkys3/XtE1TLiIiHqFAFxHxCAW6iIhHBG0OXZq+Y8eOUVhYSElJSbBLkUYQFhZGZGQkrVu3DnYpUk8KdKlRYWEhZ5xxBlFRUZhZsMuRBuSc48CBAxQWFtK9e/dglyP1pCkXqVFJSQmdOnVSmLcAZkanTp3021gzp0CXWinMWw79rJs/BbqIiEdoDl38FjXz7YAer+Dhy+scExoaSmxsbMVyZmYmv+YJ45MPtHXu3LnexxBpqhTodahviPkTVlK3tm3bkpOTU+025xzOOUJC9IumCGjKRZqZgoICevbsycSJE4mJiWHv3r089thj9OvXj7i4OObMmQPAkSNHuPzyy4mPjycmJoaMjIyKYzz99NM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nR79FxHxCF2hi4h4hAJdRMQjFOgiIh6hQBcR8QgFuoiIRyjQRUQ8QoEuIuIR/w+Lplurp+xJaQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "center.plot(kind='bar')\n",
    "plt.xticks(rotation=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
